"""
URL configuration for edu_project project.

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/5.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.contrib import admin
from django.urls import path, include
from drf_yasg.views import get_schema_view
from rest_framework import permissions
from drf_yasg import openapi

schema_view = get_schema_view(
    openapi.Info(
        title="教育项目 API 文档",
        default_version='v1',
        description="这是一个在线教育项目的API文档，提供用户管理、课程管理、学习计划、考试系统等功能。" +
                    "接口按照功能模块进行分组，包括用户模块、AI学习助手、课程模块、章节内容、题库等。",
        terms_of_service="https://www.example.com/policies/terms/",
        contact=openapi.Contact(email="contact@edu-project.com", name="教育项目团队"),
        license=openapi.License(name="MIT License"),
    ),
    public=True,
    permission_classes=(permissions.AllowAny,),
)

urlpatterns = [
    path("admin/", admin.site.urls),
    path('swagger/', schema_view.with_ui('swagger', cache_timeout=0), name='schema-swagger-ui'),
    path('redoc/', schema_view.with_ui('redoc', cache_timeout=0), name='schema - redoc - ui'),
    path('api/', include('user_app.urls')),
    path('api/', include('ai_app.urls')),
    path('api/', include('examination_questions_app.urls')),
    path('api/', include('subjects_app.urls')),
    path('api/', include('chapter_app.urls')),
    path('api/', include('content_app.urls')),
    path('api/', include('learning_progress_app.urls')),
]

# if settings.DEBUG:
#     urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
